const express = require("express");
const fs = require("fs");
const app = express();
//中间件
app.use(express.static("./www"));

// 路由中间件 处理GET请求
app.get("/a.html", (req, res) => {
  res.send("hello a.html");
});

app.get("/b.html", (req, res) => {
  res.send("hello b.html");
});

app.get("/a/b/c", (req, res) => {
  res.send("hello /a/b/c");
});

app.post("/users", (req, res) => {
  res.send("hello POST /users");
});

// app.patch()
// app.put()
// app.delete()

// 设置端口
const port = 3008;
app.listen(port, () => {
  console.log(`http://192.168.1.42:${port}`);
});
